public class People{
    private String name;
    private int age;

    int r;
    public People(){
        System.out.println("不带参数的构造方法");
    }

    public People(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带参数的构造方法");
    }

    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return this.name;
    }

    public void sleep(){
        System.out.println(this.name + "正在睡觉");
    }
}


